package com.ruoyi.system.mapper;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.AppDynamicMsg;
import com.ruoyi.system.domain.AppUser;
import org.apache.ibatis.annotations.Param;

/**
 * app用户Mapper接口
 *
 * @author ruoyi
 * @date 2023-02-27
 */
public interface AppUserMapper extends BaseMapper<AppUser> {
    /**
     * 查询app用户
     *
     * @param userId app用户主键
     * @return app用户
     */
    public AppUser selectAppUserByUserId(Long userId);

    /**
     * 查询app用户列表
     *
     * @param appUser app用户
     * @return app用户集合
     */
    public List<AppUser> selectAppUserList(AppUser appUser);

    /**
     * 新增app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int insertAppUser(AppUser appUser);

    /**
     * 修改app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int updateAppUser(AppUser appUser);

    /**
     * 删除app用户
     *
     * @param userId app用户主键
     * @return 结果
     */
    public int deleteAppUserByUserId(Long userId);

    /**
     * 批量删除app用户
     *
     * @param userIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppUserByUserIds(Long[] userIds);

    int countByMobile(String phone);

    Integer findByAccount(String account);

    List<AppUser> listByUserIds(List<String> userIds);

    /**
     * 修改用户状态：0：正常，1：冻结
     *
     * @param appUser 状态
     * @return
     */
    public int updateAppUserByState(AppUser appUser);

    /**
     * 密码修改
     *
     * @param appUser
     * @return
     */
    public int updateAppUserByPassword(AppUser appUser);

    void updateMoneyByApplyWithdrawal(@Param("userId") Long userId, @Param("withdrawalMoney") BigDecimal withdrawalMoney);

    void updateUserBalance(@Param("userId") Long userId, @Param("totalBetMoney") BigDecimal totalBetMoney);

    void updateUserMoneyByReceiveRedPacket(@Param("userId") Long userId, @Param("receiveMoney") BigDecimal receiveMoney);

    public int updateUserUsdtAddress(@Param("userId") Long userId, @Param("collectionAddress") String collectionAddress);
}
